package com.zr.util;

import com.zr.model.Content;
import com.zr.service.HangyeService;
import com.zr.service.impl.HangyeServiceImpl;

public class Hangye extends Thread{

	HangyeService hs = new HangyeServiceImpl();
	
	@Override
	public void run() {
		int total = hs.getTotalSourse();
		for (int i = 0; i == 0; ) {
			
			Content con = hs.getContentSourse(total);
			if(con != null){
				System.out.println(1111);
				ChatWebSocket cws = new ChatWebSocket();
				cws.onMessage(con.getCtitle());
				total++;
				
			}
			
			try {
				System.out.println(1111);
				sleep(8000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
	
}
